#ifndef TREE_H_
#define TREE_H_

typedef struct treenode{

    struct treenode * left;
    struct treenode * right;
    char value;
    int freq;
}TreeNode;

TreeNode * TreeNode_create(char val,int freq);

TreeNode * TreeNode_merge(TreeNode * tn1,TreeNode * tn2);

void Tree_print(TreeNode * tn,int level);

int Tree_height(TreeNode * tn);

int Tree_leaf(TreeNode * tn);

void Tree_destroy(TreeNode * tn);

void Tree_header(TreeNode * tn,unsigned int numChar,char * outfile);

#endif//!TREE_H_